package com.macro.mall.demo.controller;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.demo.service.HomeService;

import com.macro.mall.model.PmsPortalProductDetail;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 *商品  管理
 */
@Tag(name = "DemoController", description = "商品管理示例接口")
@Controller
@RequestMapping("/product")
public class ProductController {
    @Autowired
    private HomeService homeService;

    @Operation(summary = "根据编号查询品牌信息")
    @RequestMapping(value = "/detail/{id}", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<PmsPortalProductDetail> detailList(@PathVariable Long id) {

        PmsPortalProductDetail pmsProducts = homeService.detailList(id);
        return CommonResult.success(pmsProducts);
    }



}
